/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package caintra.Sapra.Pantalla.Ajuste;

import caintra.Sapra.ComponentsImplements.LabelCaintra;
import java.util.Locale;
import java.util.ResourceBundle;
import nextapp.echo2.app.Alignment;
import nextapp.echo2.app.Color;
import nextapp.echo2.app.Column;
import nextapp.echo2.app.ContentPane;
import nextapp.echo2.app.Extent;
import nextapp.echo2.app.Font;
import nextapp.echo2.app.layout.ColumnLayoutData;

/**
 *
 * @author Administrador
 */
public class Pantalla_Mensaje extends ContentPane{
    
    public LabelCaintra msj_text;
    public ResourceBundle bundle = ResourceBundle.getBundle("caintra.Sapra.Internacional.MessageBundle",Locale.US);

    public Pantalla_Mensaje() {
        msj_text=new LabelCaintra("", Color.RED);
        msj_text.setFont(new Font(Font.ARIAL, 1, new Extent(20)));
        msj_text.setTextAlignment(Alignment.ALIGN_CENTER);
        Column c=new Column();
        ColumnLayoutData cl=new ColumnLayoutData();
        cl.setAlignment(Alignment.ALIGN_CENTER);
        c.add(msj_text);
        c.setLayoutData(cl);
        c.setBackground(Color.YELLOW);

        this.add(c);


    }

    public void setMsj(String msj){
        if(msj == null || msj.trim().equals("")){
                msj_text.setText("");
        }else{
            if(bundle.containsKey(msj))
                msj_text.setText(bundle.getString(msj));
            else
                msj_text.setText(msj);

        }

    }



}
